package resolver

/*
Copyright 2021-2025 The k8gb Contributors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Generated by GoLic, for more details see: https://github.com/AbsaOSS/golic
*/

import (
	"github.com/rs/zerolog"
)

// LogFormat specifies how the logger prints values
type LogFormat string

const (
	// JSONFormat prints messages as single json record
	JSONFormat LogFormat = "json"
	// SimpleFormat prints messages in human readable way
	SimpleFormat LogFormat = "simple"
	// NoFormat, returned in situation when format is not recognised
	NoFormat = "noformat"
)

type Log struct {
	// Level
	Level zerolog.Level `env:"LOG_LEVEL" optional:"" enum:"debug,info,warn,error,trace" default:"info" help:"defines level of logger"`
	// Format
	Format LogFormat `env:"LOG_FORMAT" optional:"" enum:"simple,json" default:"simple"  help:"specifies how the logger prints values"`
	// NoColor
	NoColor bool `env:"NO_COLOR" optional:"" default:"false" help:"prints colored output if Format == simple"`
}

func (l LogFormat) String() string {
	return string(l)
}
